package boot.vertx;

import com.jueyunqi.service.ExportService;
import com.jueyunqi.vertx.ServerVerticle;
import com.jueyunqi.vertx.SpringVerticle;
import io.vertx.core.Vertx;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.concurrent.CountDownLatch;


/**
 * Created by zhongwen on 2018/3/21.
 */
@SpringBootApplication
public class VertxBootMain {
    private static CountDownLatch countDownLatch = new CountDownLatch(1);

    public static void main(String[] args){
        run(VertxBootMain.class,args);
    }

    public static void run(Class<?> clazz,String[] args){
        ConfigurableApplicationContext ctx = SpringApplication.run(clazz,args);

        Vertx vertx = Vertx.vertx();
        // 部署spring模块
        vertx.deployVerticle(new SpringVerticle(ctx));
        // 部署服务器模块
        vertx.deployVerticle(new ServerVerticle());
    }
}
